/**
 * 
 */
package tests;

import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;

/**
 * Title: SystemsTest class for CSIS 343 Final Project 
 * Description: CS 343 Final Project - SystemsTest This class will test the Systems class 
 * 
 * @author Erik Olson
 * @email erik.olson-5@my.uwrf.edu
 * @author Mike Harmon
 * @email michael.harmon@my.uwrf.edu
 * @author Jack Friermuth
 * @email jack.friermuth@my.uwrf.edu
 * @author Luke Vang
 * @email luke.vang@my.uwrf.edu
 * @author Casey Golla
 * @email casey.golla@my.uwrf.edu
 * @date December 4th 2012
 */
public class SystemsTest extends TestCase {
	private static com.project.savelog.Systems systems_default;
	private static com.project.savelog.Systems systems_alternate;

	@Before
	public void setUp() throws Exception {
		//setting up 2 dummy objects
		systems_default = new com.project.savelog.Systems();
		systems_alternate =  new com.project.savelog.Systems( 1, "Nintendo", "/home/mike/Systems", "ns", 1, 1 );
	}

	@After
	public void tearDown() throws Exception {
		//clearing objects out
		systems_default = null;
		systems_alternate = null;
	}

	/**
	 * Tests that the default constructor will set the correct defaults
	 * @Test
	 */
	public final void testDefaultConstructor() {
		assertEquals( systems_default.getSys_id(), 0, 0 );
		assertEquals( systems_default.getSys_name() , "" );
		assertEquals( systems_default.getSys_directory() , "" );
		assertEquals( systems_default.getSys_ext() , "" );
		assertEquals( systems_default.getSys_is_active() , 0, 0 );
		assertEquals( systems_default.getTheme_id() , 0, 0 );
	}
	
	/**
	 * Tests that the alternate constructor will set the provided values
	 * @Test
	 */
	public final void testAlternateConstructor() {
		assertEquals( systems_alternate.getSys_id(), 1, 0 );
		assertEquals( systems_alternate.getSys_name() , "Nintendo" );
		assertEquals( systems_alternate.getSys_directory() , "/home/mike/Systems" );
		assertEquals( systems_alternate.getSys_ext() , "ns" );
		assertEquals( systems_alternate.getSys_is_active() , 1, 0 );
		assertEquals( systems_alternate.getTheme_id() , 1, 0 );
	}
	
	/**
	 * Tests that getSys_id will return the correct system id
	 * @Test
	 */
	public final void testGetSys_id() {
		assertEquals( systems_alternate.getSys_id(), 1, 0 );
	}

	/**
	 * Tests that setSys_id will correctly set the system id
	 * @Test
	 */
	public final void testSetSys_id() {
		systems_alternate.setSys_id( 2 );
		assertEquals( systems_alternate.getSys_id(), 2, 0 );
	}

	/**
	 * Tests that getSys_name will return the correct system name
	 * @Test
	 */
	public final void testGetSys_name() {
		assertEquals( systems_alternate.getSys_name() , "Nintendo" );
	}

	/**
	 * Tests that setSys_name will correctly set the system id
	 * @Test
	 */
	public final void testSetSys_name() {
		systems_alternate.setSys_name( "Super Nintendo" );
		assertEquals( systems_alternate.getSys_name() , "Super Nintendo" );
	}

	/**
	 * Tests that getSys_directory will return the correct path to the system directory
	 * @Test
	 */
	public final void testGetSys_directory() {
		assertEquals( systems_alternate.getSys_directory() , "/home/mike/Systems" );
	}

	/**
	 * Tests that setSys_directory will correctly set the path to the system directory
	 * @Test
	 */
	public final void testSetSys_directory() {
		systems_alternate.setSys_directory( "/home/mike/new/Systems" );
		assertEquals( systems_alternate.getSys_directory() , "/home/mike/new/Systems" );
	}

	/**
	 * Tests that getSys_ext will return the correct system extension
	 * @Test
	 */
	public final void testGetSys_ext() {
		assertEquals( systems_alternate.getSys_ext() , "ns" );
	}

	/**
	 * Tests that setSys_ext will correctly set the system extension
	 * @Test
	 */
	public final void testSetSys_ext() {
		systems_alternate.setSys_ext( "nes" );
		assertEquals( systems_alternate.getSys_ext() , "nes" );
	}

	/**
	 * Tests that getSys_is_active will return the correct system active value, 1 = active, 0 = inactive
	 * @Test
	 */
	public final void testGetSys_is_active() {
		assertEquals( systems_alternate.getSys_is_active() , 1, 0 );
	}

	/**
	 * Tests that setSys_is_active will correctly set if the system is active, 1 = active, 0 = inactive
	 * @Test
	 */
	public final void testSetSys_is_active() {
		systems_alternate.setSys_is_active( 0 );
		assertEquals( systems_alternate.getSys_is_active() , 0, 0 );
	}

	/**
	 * Tests that getTheme_id will return the correct theme id
	 * @Test
	 */
	public final void testGetTheme_id() {
		assertEquals( systems_alternate.getTheme_id() , 1, 0 );
	}

	/**
	 * Tests that setTheme_id will correctly set the theme id
	 * @Test
	 */
	public final void testSetTheme_id() {
		systems_alternate.setTheme_id( 2 );
		assertEquals( systems_alternate.getTheme_id() , 2, 0 );
	}

}
